﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using RBS.Web.API.Models;

namespace RBS.Web.API.Areas.Hotel.Controllers
{
    /// <summary>
    /// 酒店图集API
    /// </summary>
    public class HotelImgController : ApiController
    {
        private ApiContext db = new ApiContext();
        /// <summary>
        /// 根据酒店ID获取酒店详细信息
        /// </summary>
        /// <param name="id">酒店ID</param>
        /// <returns></returns>
        public JsonData Get(int id)
        {
            var webHotel = RBS.Common.ConfigHelper.GetConfigString("webHotel");
            var jsonData = new JsonData { Success = true };
            var clients = db.HotelImg.Where(c => c.HotelId == id);
            jsonData.Data = clients.OrderByDescending(c => c.Id).ToList();
            return jsonData;
        } 
    }
}
